layui.use(['table', 'jquery', 'layer'], function (data) {
    var table = layui.table,
        $ = layui.jquery,
        layer = layui.layer;
    table.render({
        elem: "#purchaseHistoryEntryWareHouse",
        height: 'full-125',
        url: ctx + '/quality/selectByParamsWithEntryHistoryHistory',
        page: true,
        cellMinWidth: 80, // 单元格最小宽度
        toolbar: '#toolbarDemo',
        cols: [[// 表头
            {type: 'checkbox'},
            {type: "numbers"},
            {title: "质检单号", field: "qualityNo"},
            {
                title: "采购单号", field: "purchaseNo", templet: function (data) {
                    return data.purchaseRequestBean.purchaseNo
                }
            },

            {
                title: "物料编码", field: "materialNo", templet: function (data) {
                    return data.purchaseRequestBean.materialNo;
                }
            },
            {
                title: "物料名称", field: "materialName", templet: function (data) {
                    return data.purchaseRequestBean.materialName;
                }
            },
            {
                title: "数量", field: "purchaseCount", templet: function (data) {
                    return data.purchaseRequestBean.purchaseCount
                }
            },
            {
                title: "质检时间", field: "qualityData"
            }
            , {
                title: "结果", field: "qualityResult", templet: function (data) {
                    if (data.qualityResult == 0) {
                        return "同意";
                    }
                    if (data.qualityResult == 1) {
                        return "不同意"
                    }
                }
            },
            {
                title: "质检员", field: "qualityerId", templet: function (data) {
                    return data.empBean.empName;
                }
            }
        ]]


    })


})